package com.hy.mydesktop.shared.persistence.domain.gxt;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.hy.mydesktop.client.component.meta.GridColumnConfigModel;
import com.hy.mydesktop.shared.persistence.domain.gxt.constant.ComponentMetaDataConstants;
import com.hy.mydesktop.shared.persistence.domain.gxt.constant.MetaDataConstants;
import com.hy.mydesktop.shared.rpc.meta.GxtToSeamServiceParameter;

//@Entity
//@Table(name="t_gridmodel")
public class GridModel extends MyBaseModel {
	
	
	private static final long serialVersionUID = 4548169537810718740L;

	/**
	 * 
	 * 
	 * <ul>
	 * <li>方法含义：</li>
	 * <li>方法作者：花宏宇</li>
	 * <li>编写日期：2012-2-9；时间：下午09:27:06</li>
	 * </ul>
	 * <ul>
	 * <b>修订编号：</b>
	 * <li>修订日期：</li>
	 * <li>修订作者：</li>
	 * <li>修订原因：</li>
	 * <li>修订内容：</li>
	 * </ul>
	 * @return
	 */
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@JoinColumn(name="gridmodel_identifier")
	public Set<GridColumnConfigModel> getGridColumnConfigModels() {
		return super.get(ComponentMetaDataConstants.GRID_COLUMNCONFIG_MODELS);
	}

	public void setGridColumnConfigModels(Set<GridColumnConfigModel> gridColumnConfigModels) {
		super.set(ComponentMetaDataConstants.GRID_COLUMNCONFIG_MODELS, gridColumnConfigModels);
	}
	
	@OneToMany(cascade={CascadeType.REMOVE,CascadeType.ALL},fetch=FetchType.EAGER)
	@JoinColumn(name="gridmodel_identifier")
	public Set<ItemOfAssociateToWindow> getChildrenItems ( )
	{
		return this.get (ComponentMetaDataConstants.CHILDREN_ITEMS ) ;
	}
	
	public void setChildrenItems (Set<ItemOfAssociateToWindow> childrenItems )
	{
		this.set (ComponentMetaDataConstants.CHILDREN_ITEMS,  childrenItems) ;
	}
	
	/*//@Column(nullable=true)
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@JoinColumn(name="gridmodel_identifier")
	public Set<GxtToSeamServiceParameter> getGxtToSeamServiceParameters() {
		return super.get(MetaDataConstants.GXT_TO_SEAM_SERVICEPARAMETER_MODEL);
	}

	public void setGxtToSeamServiceParameter(Set<GxtToSeamServiceParameter> gxtToSeamServiceParameters) {
		super.set(MetaDataConstants.GXT_TO_SEAM_SERVICEPARAMETER_MODEL, gxtToSeamServiceParameters);
	}*/

}
